home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10417 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: seagull.rtd.com!collins
  2. From: collins@RTD.COM (Ronald Collins)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Standard question - pointer initialization
  5. Date: 17 Mar 1996 17:44:14 GMT
  6. Organization: RTD Internet Access
  7. Message-ID: <4ihj1e$c83@baygull.rtd.com>
  8. References: <4hk9un$906@hammer.msfc.nasa.gov> <4hnpsl$g8c@hacgate2.hac.com> <4hq9hsINN998@keats.ugrad.cs.ubc.ca> <4i7cgn$5da@baygull.rtd.com> <4i9jfdINNbbv@keats.ugrad.cs.ubc.ca>
  9. NNTP-Posting-Host: seagull.rtd.com
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Kazimir Kylheku (c2a192@ugrad.cs.ubc.ca) wrote:
  13. : In article <4i7cgn$5da@baygull.rtd.com>,
  14. : Ronald Collins <collins@RTD.COM> wrote:
  15. :  >Kazimir Kylheku (c2a192@ugrad.cs.ubc.ca) wrote:
  16. :  >
  17. [snip]
  18.  
  19. : You read the standard _and_ the FAQ yourself! In what the rest of the world
  20. : agrees upon as the the definition of the C language, constant integral 
  21. : expressions with a value of zero are converted to a null pointer when they
  22. : appear in a pointer context (such as an assignment to, or comparison with,
  23. : a pointer).
  24.  
  25. This is only true for _constant_ expressions of 0 (see Tanmoy's post).
  26. Not every "0" is a constant "0".  For example, setting a variable to 0,
  27. then casting that variable to a pointer _does not_ guarantee a conversion
  28. to the NULL pointer.
  29.  
  30. [another snip]
  31.  
  32. : As a newcomer to comp.lang.c, you have fallen into the trap of assuming
  33. : that since you are competent in C programming, the contents of the FAQ
  34. : is just a bunch of stuff that agrees with what you already know, and
  35. : thus you are exempt from actually reading it, though as an obvious
  36. : expert you may refer others to the document.
  37. : -- 
  38.  
  39. Actually, the FAQ has been one of my standard desk references for
  40. several years.  Your original post of saying "a 0 converts to a NULL"
  41. was ambiguous; in the context I read it I took it to mean _any_ 0
  42. will cast to a NULL.  This is not the case.
  43.  
  44. If I ("an obvious expert" ?) can mis-understand your postings, what about
  45. the people who come here looking for answers to (for them) very 
  46. confusing situations?
  47.  
  48.             -- collins --
  49.  
  50.